<template>
  <div style="min-width: 800px">
    <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
    >
      <el-menu-item index="0" style="position: absolute; left: 0;top: -20px;">
        <img
          src="../assets/logo.svg"
          alt=""
          style="width: 130px; height: 100px"
        />
      </el-menu-item>
      <el-menu-item index="1">首页</el-menu-item>
      <el-submenu index="2">
        <template slot="title">关于南京</template>
        <el-menu-item index="2-1">南京历史</el-menu-item>
        <el-menu-item index="2-2">南京文化</el-menu-item>
        <el-menu-item index="2-3">南京名人</el-menu-item>
        <el-submenu index="2-4">
          <template slot="title">南京景点</template>
          <el-menu-item index="2-4-1">夫子庙</el-menu-item>
          <el-menu-item index="2-4-2">鸡鸣寺</el-menu-item>
          <el-menu-item index="2-4-3">紫金山</el-menu-item>
        </el-submenu>
      </el-submenu>
      <el-menu-item index="3" disabled>南京攻略</el-menu-item>
      <el-menu-item index="4"
        ><a href="https://www.ele.me" target="_blank">关于我们</a></el-menu-item
      >
      <el-menu-item index="5"><i class="el-icon-user-solid" style="font-size: 14px;margin-right: -2px;"></i>注册/登录</el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: "NavHeader",
  props: {
    msg: String,
  },
  data() {
    return {
      activeIndex: "1",
      activeIndex2: "1",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style scoped>
.el-menu {
  align-items: center; /* 垂直居中 */
  justify-content: center; /* 水平居中 */
}

.el-menu-demo {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-right: 30px;
}
</style>
